package com.gump.essay.设计模式;

/**
 * 枚举单例
 *
 * @auther zzc
 * @date 2021 04 18
 */
public class User {

    public User() {

    }

    static enum SignletonEnum {
        SIGNLETON;
        public User user;

        private SignletonEnum() {
            user = new User();
        }

        public User getInstnce() {
            return user;
        }
    }

    public static User getInstance() {
        return SignletonEnum.SIGNLETON.getInstnce();
    }
}
